package br.com.fogas.database;

import java.math.BigDecimal;
import java.util.Date;

import br.com.fogas.utils.FogasUtility;
import br.com.fogas.utils.StringUtility;

public class UtilsDatabase {
	
	public static Date getDataDefault(String value) {
		return FogasUtility.data.getDateByStringAndFormat(value, ConstantsDatabase.DATE_FORMAT);
	}
	
	public static BigDecimal getCampoValor(String value) {
		BigDecimal juros = null;
		
		if(StringUtility.isNotEmpty(value)) {
			try {
				Double vlD = Double.valueOf(value);
				juros = BigDecimal.valueOf(vlD);
			} catch (NumberFormatException e) {
				e.printStackTrace();
			}
		}
		return juros;
	}
}
